import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComponent;


public class JConnect3Slot extends JButton{
	
	Color color = new Color(200, 200, 210);
	public JConnect3Slot(){
		super("  ");
		int x = getWidth();
		setSize(x, x);
	}
	
	public void setBackground(Color _color){
		color=_color;
		paint(getGraphics());
	}
	
	public void paint(Graphics g){
		
		Graphics2D g2 = (Graphics2D)g;
		
		
		int x = getWidth();
		int y = getHeight();
		
		
		int xPos=getVisibleRect().x;
		int yPos=getVisibleRect().y;
		
		if(g2!=null){
			g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
			g2.setColor(new Color(200, 200, 200));
			g2.fillRect(xPos, yPos, x, y);
			g2.setColor(new Color(220, 220, 220));
			g2.fillRect(xPos+1, yPos+1, x-1, y-1);
						
			g2.setColor(color);
			g2.fillOval(xPos+2, yPos+2, x-4, y-4);			
		}
	}

}
